﻿// <com.woyouqiu.Copyright>
// --------------------------------------------------------------
// <copyright>上海有求网络科技有限公司 2015</copyright>
// <Solution>MyCompany.MyProject</Solution>
// <Project>MyCompany.MyProject.Application</Project>
// <FileName>ICityAppService.cs</FileName>
// <CreateTime>2017-04-22 16:42</CreateTime>
// <Author>何苗</Author>
// <Email>hemiao@woyouqiu.com</Email>
// <log date="2017-04-22 16:42" version="00001">创建</log>
// --------------------------------------------------------------
// </com.woyouqiu.Copyright>

using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Vecen.BangChuang.BangChuang.Areas.DomainDtos;
using Vecen.BangChuang.BangChuang.Areas.Dtos;

namespace Vecen.BangChuang.BangChuang.Areas {
    /// <summary>
    /// 城市操作
    /// </summary>
    public interface ICityAppService: IApplicationService {

        /// <summary>
        /// 根据IP获得城市信息
        /// </summary>
        /// <param name="ipAddress"></param>
        /// <returns></returns>
        Task<FullCityOutDto> GetByIp(string ipAddress);

        /// <summary>
        /// 根据坐标获取城市信息
        /// </summary>
        /// <param name="coordinate"></param>
        /// <returns></returns>
        Task<FullCityOutDto> GetByCoordinate(Coordinate coordinate);
            /// <summary>
        ///根据ID获得城市信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<CityOutDto> GetById(long id);


        /// <summary>
        /// 根据父节点ID获得子节点
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        Task<ListResultDto<CityOutDto>> GetByParentId(int? parentId);

        /// <summary>
        /// 刷新城市数据
        /// </summary>
        /// <returns></returns>
        Task<int> RefreshCitiesData();
    }
}